<%-- 
    Document   : warehouse
    Created on : 10.05.2013, 23:07:22
    Author     : freest
--%>

<%@page import="report.Report"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>Warehouse Report Demo</h1><br>
        <form>
            <table>
                <tr>
                    <td>Warehouse Number:</td>
                    <td><input type="number" value="1" id="warehouse"/></td>
                </tr>
                <tr>
                    <td>Rank:</td>
                    <td><input type="number" value="10" id="limit"/></td>
                </tr>
            </table>
        </form>
        <button id="submit">Create report</button><br>
        <div id="result"></div>
        <script src="http://code.jquery.com/jquery-latest.js">   
        </script>
        <script>
            $(document).ready(function() {                        
                $('#submit').on('click',function() { 
                    $.ajax({
                        type: "POST",
                        url: "createExcelReport.jsp",
                        data: { limit : $('#limit').val(),
                                warehouse: $('#warehouse').val()}
                     }).done(function(reportPath) {
                        $('#result').text("Report path: " + reportPath);
                      });
        
                });
            });
        </script>
    </body>
</html>
